﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Web;
using System.Web.UI.WebControls;

namespace TSV.Models
{
    public enum Role
    {
        Manager = 1
    }

    public enum Modules
    {        
        QL_Nhom = 1,
        QL_Nguoi_Dung = 2,
        QL_So_Huu_The_SV=3,
        QL_DK_Lam_Doi_Tac=4,
        QL_Cong_Tac_Vien = 5,
        QL_Email_Dang_Ky=6,
        QL_Tin_Tuc=7,
        QL_Bai_Viet=8,
        QL_Ban_Tin=9,
        QL_Quang_Cao=10,
        QL_Doi_Tac = 11,
        QL_Tin_Khuyen_Mai = 12,
        QL_Thu_Vien_Hinh = 13,
        QL_Danh_Muc = 14
    }

    public enum Permissions
    {                
        Doc = 1,
        Them = 2,
        Sua = 3,
        Xoa = 4,       
        Gan = 5        
    }

    /// <summary>
    /// Permission Constants
    /// </summary>
    public class PermissionConstants
    {
        /// <summary>
        /// Get Permission List
        /// </summary>
        public static List<ListItem> ListModule
        {
            get
            {
                List<ListItem> functionList = new List<ListItem>();
                Array arrFuncs = Enum.GetValues(typeof(Modules));
                for (int i = 0; i < arrFuncs.Length; i++)
                {
                    Modules f = (Modules)arrFuncs.GetValue(i);
                    functionList.Add(new ListItem(f.ToString(), f.GetHashCode().ToString()));
                }
                return functionList;
            }
        }


        /// <summary>
        /// Get Permission List
        /// </summary>
        public static List<ListItem> ListPermission
        {
            get
            {
                List<ListItem> permissionList = new List<ListItem>();
                Array arrFuncs = Enum.GetValues(typeof(Permissions));
                for (int i = 0; i < arrFuncs.Length; i++)
                {
                    Permissions f = (Permissions)arrFuncs.GetValue(i);
                    permissionList.Add(new ListItem(f.ToString(), f.GetHashCode().ToString()));
                }
                return permissionList;
            }
        }
    }
}